"""django_study URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

import app_test01.views
import app_test02.views
urlpatterns = [
    # path('admin/', admin.site.urls),  # 默认生成
    path('index/', app_test01.views.index),  # url访问 index  ，就可以访问函数了
    path('html_test01/',app_test01.views.html_test01),
    path('html_test02/', app_test01.views.html_test02),
    path('news/', app_test01.views.news),
    path('webrequest/', app_test01.views.webrequest),

    #用户登录
    path('login/', app_test01.views.login),
    # orm测试
    path('orm/', app_test01.views.orm),
    path('infomanagement/', app_test01.views.management),
    path('infoadd/', app_test01.views.infoadd),
    path('delete/',app_test01.views.delete),
    # App2
    # 部门管理
    path('department/',app_test02.views.department),
    path('department/add',app_test02.views.department_add),
    path('department/delete',app_test02.views.department_delete),
    path('department/<int:id>/edit',app_test02.views.department_edit),
    #人员管理
    path('user',app_test02.views.user),
    path('user/add',app_test02.views.user_add),

    # # form
    # path('user/add/form',app_test02.views.user_add_form),
    #modeldorm
    path('user/add/form',app_test02.views.user_add_modeldorm),
    path('user/<int:id>/edit',app_test02.views.user_edit),
    path('user/<int:id>/delete',app_test02.views.user_delete),

    #号码管理
    path('telnumber/',app_test02.views.telnumber),
    path('telnumberadd',app_test02.views.telnumberadd),
              # /telnumber/{{item.id}}/edit
              # /telnumber/<int:id>/edit 前面不能加/
    path('telnumber/<int:id>/edit',app_test02.views.telnumberedit),
    path('telnumber/<int:id>/delete',app_test02.views.telnumberdelete),

    # admin
    path('admin',app_test02.views.admin),
    path('admin/add',app_test02.views.admin_add),
    path('admin_edit/<int:id>',app_test02.views.admin_edit),
    path('admin_delete/<int:id>',app_test02.views.admin_delete),

    #login
    path('',app_test02.views.user_login),
]

